import React from 'react';
import { Tabs } from 'antd';
import { connect } from 'dva';

import styles from './index.less';
import Management from '../accessManagement/management';

const { TabPane } = Tabs;

/**
 *  登录界面
 */
@connect(({ loading }) => ({
  //控制状态，绑定事件
  submitting: loading.effects['login/doLogin']
}))
class AccessManagement extends React.Component {
  handleChangeTab = e => {
    this.setState({
      tabCurrent: e
    });
  };

  selectChange = e => {
    alert(e);
  };
  state = {
    tabCurrent: '1'
  };

  render() {
    const { tabCurrent } = this.state;
    return (
      <div className={styles.approved}>
        <div>
          <h3>Access management</h3>
        </div>
        <Tabs activeKey={tabCurrent} onChange={this.handleChangeTab}>
          <TabPane tab="Role management" key="1">
            <Management />
          </TabPane>
          <TabPane tab="Permissions" key="2"></TabPane>
        </Tabs>
      </div>
    );
  }
}
export default AccessManagement;
